import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a1227
 * Date: 2022-10-07
 * Time: 13:58
 */
//JAVA21 补全构造方法——https://www.nowcoder.com/practice/d3fa8fb4caf449b0809528fe569dbbc6?tpId=220&tqId=2113522&ru=/exam/oj&qru=/ta/primary-grammar-java/question-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3D%25E8%25AF%25AD%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D220
/*
class Base{
    public int x;
    public int y;
    public Base(int x,int y){
        this.x = x;
        this.y = y;
    }
}
class Sub extends Base{
    public int z;
    public Sub(int x,int y,int z){
        super(x,y);
        this.z = z;
    }
    public void calculate(){
        int product = super.x * super.y * this.z;
        System.out.println(product);
    }
}*/

//JAVA22 重写计算逻辑——https://www.nowcoder.com/practice/af4fd657b63241a3a0613d5c487a252f?tpId=220&tqId=2111639&ru=/exam/oj&qru=/ta/primary-grammar-java/question-ranking&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3D%25E8%25AF%25AD%25E6%25B3%2595%25E7%25AF%2587%26topicId%3D220
/*
abstract class Base{
    public abstract void calculate();
}

class Sub extends Base{
    public int x;
    public int y;
    public Sub(int x,int y){
        this.x = x;
        this.y = y;
    }
    public void calculate(){
        if(y == 0){
            System.out.println("Error");
        }else{
            System.out.println(x / y);
        }
    }
}*/

public class Test {
    //JAVA21 补全构造方法
    /*
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int x = in.nextInt();
            int y = in.nextInt();
            int z = in.nextInt();
            Sub sub = new Sub(x,y,z);
            sub.calculate();
        }
    }*/

    //JAVA22 重写计算逻辑
    /*
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b = in.nextInt();
            Sub sub = new Sub(a,b);
            sub.calculate();
        }
    }*/
}
